<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box1{
            position: sticky 
        }
    </style>
</head>
<body>
    <div id="box1" style="top:10px;margin:20px 10px;">
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    </div>
    <div id="box">
        {{msg}}
      1  {{gettime()}}/
       2 {{gettime2}}
       <p> <button @click="sub">-</button>
        <span>{{count}}</span>
        <button @click="add">+</button>
    </p>
       <strong>{{msg}}</strong><br>
       <strong v-text="msgs"></strong>
       <input v-model="msgs" @keyup.enter="getmsg">
        <mycom v-for="item in items" v-bind:text="items[0]"></mycom>
        <mycom v-for="item in items" v-bind:text="item"></mycom>
        <mycom v-for="item in items" v-bind:text="item"></mycom>
        <mycom v-for="item in items" v-bind:text="item"></mycom>
        <mycom v-for="item in items" v-bind:text="item"></mycom>
        <mycom v-for="item in items" v-bind:text="item"></mycom><mycom v-for="item in items" v-bind:text="item"></mycom><mycom v-for="item in items" v-bind:text="item"></mycom><mycom v-for="item in items" v-bind:text="item"></mycom>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        
        Vue.component("mycom",{
            props:['text'],
            template:'<h1>{{text}}</h1>'

        });
         var vm = new Vue({
                el:"#box",
                data:{
                   msg: "hello vue!",
                   msgs:"",
                   items:["a","b","c"],
                   isInvail:true,
                   count:0
                },
                methods:{
                    getmsg:function(){
                        console.log(this.msgs)
                    },
                    gettime:function(){
                        return Date.now()
                    },
                    add:function(){
                        this.count++
                    },
                    sub:function(){
                        this.count--
                    }
                },
                computed:{
                    gettime2:function(){
                        this.msg
                        return Date.now()
                    }
                }
            })
    </script>
</body>
</html>